Intersection Type Matching with Subtyping
نویسندگان
چکیده
Type matching problems occur in a number of contexts, including library search, component composition, and inhabitation. We consider the intersection type matching problem under the standard notion of subtyping for intersection types: Given intersection types τ and σ, where σ is a constant type, does there exist a type substitution S such that S(τ) is a subtype of σ? We show that the matching problem is NP-complete. NP-hardness holds already for the restriction to atomic substitutions. The main contribution is an NP-algorithm which is engineered for efficiency by minimizing nondeterminism and running in Ptime on deterministic input problems. Our algorithm is based on a nondeterministic polynomial time normalization procedure for subtype constraint systems with intersection types. We have applied intersection type matching in optimizations of an inhabitation algorithm.
منابع مشابه
Intersection Types with Subtyping by Means of Cut Elimination
We give a purely syntactic proof (from scratch) of the subject equality property of the BCD intersection type system through a reformulation of the subtyping relation having a “cutelimination” property.
متن کاملEncoding CDuce in the Cπ-calculus?
CDuce is a functional programming language featuring overloaded functions and a rich type system with recursive types, subtyping, union, negation and intersection types. The boolean constructors have a set-theoretic behaviour defined via a semantic interpretation of the types. The Cπ-calculus is an extension of the π-calculus that enriches Pierce and Sangiorgi π-calculus subtyping with union, i...
متن کاملType Inference for the Mixture of Matching and Implicit Subtyping
We present a type inference system for a language with object-oriented features such as polymorphic record access and subtyping. We separate the notion of matching and subtyping in order to avoid di culties caused by recursive type constraints. We will use two kinds of type constraints | record (variant) constraints and subtyping constraints. Then, we discuss simpli cation of such mixed type co...
متن کاملDecidability of Higher-Order Subtyping with Intersection Types
The combination of higher-order subtyping with intersection types yields a typed model of object-oriented programming with multiple inheritance 11]. The target calculus, F ! ^ , a natural generalization of Girard's system F ! with intersection types and bounded polymorphism, is of independent interest, and is our subject of study. Our main contribution is the proof that subtyping in F ! ^ is de...
متن کاملIntersection Types and Bounded Polymorphism
Intersection types and bounded quantiication are complementary extensions of a rst-order programming language with subtyping. We deene a typed-calculus combining these extensions, illustrate its unusual properties, and develop basic proof-theoretic and semantic results leading to algorithms for subtyping and typechecking.
متن کامل